#include <iostream>

using namespace std;
typedef void(*Fun)(void);

class A{
public:
    virtual void hello(){
        cout << "hello A" << endl;
    }
};

class B{
public:
    void hello(){
        cout << "hello B" << endl;
    }
};

class C{
public:
    virtual void hello(){
        cout << "hello C" << endl;
    }
};

int main(){
    cout << sizeof(A) << endl;
    cout << sizeof(B) << endl;
    cout << sizeof(C) << endl;
    cout << sizeof(int) << sizeof(long) << endl;
    A a;

    cout << "虚函数表地址：" << (long*)(&a) << endl;
    cout << "虚函数表第一个虚函数指针地址：" <<(long*)*(long*)(&a) << endl;
    Fun fp = nullptr;
    fp = (Fun)*((long*)*(long*)(&a));
    fp();

}